import { request } from '@/utils/request';

// 获取customList数据
export function getCustomColumns(params) {
  return request({
    url: '/govern/custom-column/get',
    headers: {
      isToken: true
    },
    method: 'GET',
    params
  });
}

//获取煤源列表
export function saveCustomColumn(data) {
  return request({
    url: '/govern/custom-column/addOrUpdate',
    headers: {
      isToken: true
    },
    method: 'POST',
    data
  });
}

//获取煤源列表
export function getCollieryList(data) {
  return request({
    url: '/govern/colliery/get-list',
    headers: {
      isToken: true
    },
    method: 'POST',
    data: data
  });
}

// 修改煤价信息
export function updateColliery(data) {
  return request({
    url: '/govern/colliery/update',
    method: 'PUT',
    data: data
  });
}

//新增煤源
export function addCollieryData(data) {
  return request({
    url: '/govern/colliery/create',
    headers: {
      isToken: true
    },
    method: 'POST',
    data: data
  });
}

//获取单条煤源信息
export function getOneColliery(data) {
  return request({
    url: `/govern/colliery/get`,
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}
//获取煤源地图
export function getCollieryMap(data) {
  return request({
    url: `/govern/colliery/map`,
    headers: {
      isToken: true
    },
    method: 'GET',
    data: data
  });
}

// 煤种收藏
export function createCoalCollect(data) {
  return request({
    url: '/gvCoalCollect/create',
    headers: {
      isToken: true
    },
    method: 'POST',
    data: data
  });
}

// 取消煤种收藏
export function deleteCoalCollect(id) {
  return request({
    url: `/gvCoalCollect/delete?id=${id}`,
    headers: {
      isToken: true
    },
    method: 'DELETE'
  });
}

// 短倒卸货地
export function getAllList() {
  return request({
    url: '/gvShortPriceSetting/getAllList',
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}
